<template>
  <div>
    <el-row :gutter="10">
      <el-col :span="6">
        <el-menu
          background-color="#545c64"
          text-color="#fff"
          active-text-color="#ffd04b"
          unique-opened
          :default-openeds="['1']"
          default-active="1-1"
          @select="handleSelect"
        >
          <el-submenu index="1">
            <template slot="title">
              <i class="el-icon-location"></i>
              <span>导航一</span>
            </template>
            <el-menu-item index="/addNews">添加新闻</el-menu-item>
            <el-menu-item index="/newsList">新闻列表</el-menu-item>
          </el-submenu>
          <el-submenu index="2">
            <template slot="title">
              <i class="el-icon-menu"></i>
              <span>导航二</span>
            </template>
            <el-menu-item index="2-1">选项1</el-menu-item>
            <el-menu-item index="2-2">选项2</el-menu-item>
          </el-submenu>
          <el-submenu index="3">
            <template slot="title">
              <i class="el-icon-setting"></i>
              <span>导航三</span>
            </template>
            <el-menu-item index="3-1">选项1</el-menu-item>
            <el-menu-item index="3-2">选项2</el-menu-item>
          </el-submenu>
        </el-menu>
      </el-col>
    </el-row>

  </div>
</template>

<script>
  export default {
    name: "NavMenu",
    data(){
      return {
        isCollapse:false
      }
    },
    methods:{
      handleSelect(index){
        console.log(index);
      }
    }
  }
</script>
